let header = {
	'content-type': 'application/json'
}
// 公共模块
let contents = '/api/home/contents'; //获取协议


// 用户部分
let getOpenid = '/api/user/getOpenid'; //获取openid
let OtherLogin = '/api/user/OtherLogin'; //小程序登录
let getmdss = '/api/home/getmdss'; //首页金刚区
let banners = '/api/home/banners'; //首页轮播图
let MyIndex = '/api/home/MyIndex'; //个人信息
let profile = '/api/user/profile'; //修改个人信息
let myorders = '/api/home/myorders'; //我的订单
let myqaks = '/api/home/myqaks'; //我的咨询


// 客服部分
let logout = '/api/user/logout'; //注销
let login = '/api/user/login'; //登录
let send = '/api/sms/send'; //发送验证码
// 客服列表
let kulist = '/api/home/kulist'; //客服列表

let resetpwd = '/api/user/resetpwd'; //重置密码
let kfsendloans = '/api/home/kfsendloans'; //客服分配律师

let setOrder = '/api/order/kfCreate';
let layTranfer = '/api/order/lawyerTransfer'
let trasTranfer =  'api/order/transferLawyer'
const install = (Vue, vm) => {
	// 公共模块
	let _contents = (params = {}) => vm.$u.post(contents, params);
	// 用户部分
	let _getOpenid = (params = {}) => vm.$u.post(getOpenid, params);
	let _OtherLogin = (params = {}) => vm.$u.post(OtherLogin, params);
	let _getmdss = (params = {}) => vm.$u.post(getmdss, params);
	let _banners = (params = {}) => vm.$u.post(banners, params);
	let _myIndex = (params = {}) => vm.$u.post(MyIndex, params);
	let _profile = (params = {}) => vm.$u.post(profile, params);
	let _myorders = (params = {}) => vm.$u.post(myorders, params);
	let _myqaks = (params = {}) => vm.$u.post(myqaks, params);



	// 客服部分
	let _login = (params = {}) => vm.$u.post(login, params);
	let _send = (params = {}) => vm.$u.post(send, params);
  let _logout = (params = {}) => vm.$u.post(logout, params);
	// 客服列表
	let _kulist = (params = {}) => vm.$u.post(kulist, params);
	let _resetpwd = (params = {}) => vm.$u.post(resetpwd, params);
	let _kfsendloans = (params = {}) => vm.$u.post(kfsendloans, params);
  let _setOrder = (params = {}) => vm.$u.post(setOrder, params);
  let _layTranfer = (params = {}) => vm.$u.get(layTranfer, params);
  let _trasTranfer = (params = {}) => vm.$u.get(trasTranfer, params);
	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		// 公共模块
		_contents,
		// 用户部分
		_getOpenid,
		_OtherLogin,
		_getmdss,
		_banners,
		_myIndex,
		_profile,
		_myorders,
		_myqaks,
		// 客服部分
		_login,
		_send,
    _layTranfer,
    _trasTranfer,
		// 客服列表
		_kulist,
		_resetpwd,
		_kfsendloans,
    _setOrder,
    _logout
	};
}

export default {
	install
}